﻿namespace GcdAndLcm
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入第一个正整数m：");
            int m = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个正整数n：");
            int n = int.Parse(Console.ReadLine());

            int originalM = m;
            int originalN = n;

            while (n != 0)
            {
                int temp = n;
                n = m % n;
                m = temp;
            }

            int gcd = m;
            int lcm = (originalM * originalN) / gcd;

            Console.WriteLine($"最大公约数：{gcd}");
            Console.WriteLine($"最小公倍数：{lcm}");
            Console.ReadLine();
        }
    }
}